<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 27662
  Date: 2024/9/3
  Time: 10:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>plan</title>
    <link rel="stylesheet" href="../static/medical/css/bootstrap.min.css">
    <script src="../static/js/jquery.min.js"></script>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Medicamp Responsive Bootstrap Template">
    <meta name="keywords" content="Pixel">
    <meta name="author" content="rkwebdesigns">
    <!-- Site Title   -->
    <title>首页</title>
    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/css/bootstrap-dropdownhover.min.css" rel="stylesheet">
    <!-- Fonts Awesome -->
    <link href="${pageContext.request.contextPath}/static/css/font-awesome.min.css" rel="stylesheet">
    <!-- Google Fonts -->
    <link href='https://fonts.googleapis.com/css?family=Raleway:400,200,300,100,500,600,700,800,900' rel='stylesheet' type='text/css'>
    <link href="https://fonts.googleapis.com/css?family=Poppins:300,400" rel="stylesheet">
    <!-- animate Effect -->
    <link href="${pageContext.request.contextPath}/static/css/animate.css" rel="stylesheet">
    <!-- Main CSS -->
    <link href="${pageContext.request.contextPath}/static/css/style.css" rel="stylesheet">
    <!-- Responsive CSS -->
    <link href="${pageContext.request.contextPath}/static/css/responsive.css" rel="stylesheet">
</head>
<body>
<header id="header" class="head">
    <div class="top-header">
        <div class="container">
            <div class="row ">
                <ul class="contact-detail2 col-md-6 pull-left">
                    <li> <i class="fa fa-mobile" style="color: white"></i><font color="white">联系我们 +86 4004008299 </font></li>
                </ul>
                <div class="social-links col-md-6 pull-right">
                    <ul class="social-icons pull-right">
                        <li> <i class="fa fa-envelope-o" style="color: white"></i><font color="white"> yiliaojiankang@gmail.com </font></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <nav class="navbar navbar-default navbar-menu">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="index.html">
                    <div class="logo-text"><span><samp>医</samp>医疗</span>健康系统</div>
                    <!-- <img src="${pageContext.request.contextPath}/static/img/logo.png" alt="logo"> -->
                </a>
            </div>
            <form action="${pageContext.request.contextPath}/doctorInfo/parseId.do?id=${id}" method="post">
                <input type="hidden" name="id" value="${id}">
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" data-hover="dropdown" data-animations="fadeIn">
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="${pageContext.request.contextPath}/doctorInfo/parseId.do?id=${id}">首页</a></li>
                        <li><a href="${pageContext.request.contextPath}/plan/findAllPai2.do?id=${id}">排班</a></li>
                        <li><a href="${pageContext.request.contextPath}/doctor/docexam.do?id=${id}">体检</a></li>
                        <li><a href="${pageContext.request.contextPath}/register/findDoctorById.do?id=${id}">挂号</a></li>
                        <li><a href="${pageContext.request.contextPath}/">咨询</a></li>
                        <li><a href="${pageContext.request.contextPath}/messageList/messageFindAll4.do">公告</a></li>
                        <li><a href="${pageContext.request.contextPath}/doctorInfo/findDoctorById.do?id=${id}">个人中心</a></li>
                    </ul>
                </div>
            </form>
        </div>
    </nav>
</header>
<center>
    <h2>排班列表</h2>
    <form id="f1" action="${pageContext.request.contextPath}/plan/findAllPai2.do" method="get">
        <!--添加隐藏域 去第几页把页码数交给form中pageNum属性-->
        <input type="hidden" name="pageNum" id="pn1">
        <%-- 每页几条--%>
        <input type="hidden" name="pageSize" id="ps1">
        <input type="text" name="likeName" value="${likeName}">
        <input type="submit" value="搜索">
    </form>
    <table class="table table-striped">
        <tr align="center">

            <th>序号</th>
            <th>医生姓名</th>

            <th>科室</th>
            <th>就诊数量</th>

            <th>周几</th>
            <th>操作</th>
        </tr>
        <c:forEach var="plan" items="${page.list}">
            <tr align="center">

                <td>${plan.id}</td>
                <td>${plan.doctor_name}</td>
                <td>${plan.department_name}</td>
                <td>${plan.number}</td>
                <td>${plan.week}</td>
                <td>
                    <button onclick="toUpdatePaiBan(${plan.id},${page.pageNum},${page.pageSize})">编辑</button>
                </td>
            </tr>
        </c:forEach>
    </table>
    当前第${page.pageNum}页/总共${page.pages}页，共${page.total} 条数据。 每页
    <select id="ps2">
<%--        <!--数据回显 防止丢失-->--%>
        <option value="1" ${page.pageSize==1?'selected=selected':''}>1</option>
        <option value="2" ${page.pageSize==2?'selected=selected':''}>2</option>
        <option value="3" ${page.pageSize==3?'selected=selected':''}>3</option>
        <option value="4" ${page.pageSize==4?'selected=selected':''}>4</option>
        <option value="5" ${page.pageSize==5?'selected=selected':''}>5</option>
    </select> 条
        <a href="javascript:go(1)" aria-label="Previous">首页</a>
    <%--                            判断有没有上一页--%>
    <c:if test="${page.hasPreviousPage}">
            <a href="javascript:go(${page.prePage})">上一页</a>
    </c:if>
    <a href="javascript:go(1)">1</a>
    <a href="javascript:go(2)">2</a>
    <a href="javascript:go(3)">3</a>
    <a href="javascript:go(4)">4</a>
    <a href="javascript:go(5)">5</a>

    <%--判断有没有下一页--%>
    <c:if test="${page.hasNextPage}">
        <a href="javascript:go(${page.nextPage})">下一页</a>
    </c:if>
        <a href="javascript:go(${page.pages})" aria-label="Next">尾页</a>
</center>

<script src="../static/js/jquery.min.js"></script>
<script src="../static/js/bootstrap.min.js"></script>
<script src="../static/js/jquery.plugin.min.js"></script>
<script src="../static/js/jquery.isotope.min.js"></script>
<script src="../static/js/jquery.magnific-popup.min.js"></script>
<script src="../static/js/bootstrap-dropdownhover.min.js"></script>
<script src="../static/js/wow.min.js"></script>
<script src="../static/js/waypoints.min.js"></script>
<script src="../static/js/jquery.counterup.min.js"></script>
<script src="../static/js/main.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/jquery.plugin.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/jquery.isotope.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/jquery.magnific-popup.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/bootstrap-dropdownhover.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/wow.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/waypoints.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/jquery.counterup.min.js"></script>
<script src="${pageContext.request.contextPath}/static/js/js_wjh/js_wjh1/main.js"></script>


<script src="${pageContext.request.contextPath}/static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/jQueryUI/jquery-ui.min.js"></script>
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/raphael/raphael-min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/morris/morris.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/sparkline/jquery.sparkline.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/knob/jquery.knob.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/daterangepicker/moment.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/daterangepicker/daterangepicker.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/daterangepicker/daterangepicker.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/fastclick/fastclick.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/iCheck/icheck.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/adminLTE/js/app.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/treeTable/jquery.treetable.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/select2/select2.full.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.zh-CN.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-markdown/js/bootstrap-markdown.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-markdown/locale/bootstrap-markdown.zh.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-markdown/js/markdown.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-markdown/js/to-markdown.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/ckeditor/ckeditor.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/input-mask/jquery.inputmask.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/datatables/dataTables.bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/chartjs/Chart.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/flot/jquery.flot.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/flot/jquery.flot.resize.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/flot/jquery.flot.pie.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/flot/jquery.flot.categories.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/ionslider/ion.rangeSlider.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-slider/bootstrap-slider.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-datetimepicker/bootstrap-datetimepicker.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/bootstrap-datetimepicker/locales/bootstrap-datetimepicker.zh-CN.js"></script>
</body>
<script>
    function go(pageNum){
        //当前页 pageNum 交给form表单
        $("#pn1").val(pageNum)
        var pageSize = $("#ps2 option:selected").val();
        // alert(pageSize);
        //每页几条数据 pageSize 交给form表单
        $("#ps1").val(pageSize)
        $("#f1").submit();
    }

    //改变事件 当每页几条数据改变时
    $("#ps2").change(function (){
        var pageSize = $("#ps2 option:selected").val();
        $("#ps1").val(pageSize);
        // 设置当前页码数
        $("#pn1").val(${page.pageNum})
        $("#f1").submit();
    })

    //修改用户信息
    function toUpdatePaiBan(id,pageNum,pageSize){
        window.location.href="${pageContext.request.contextPath}/doctor/toUpdatePai.do?id="+id+"&pageNum="+pageNum+"&pageSize="+pageSize;
    }
</script>
</html>
